#!/usr/bin/env python
#-------------------------------python---------------------demoplot.py--#
#                                                                       #
#                    traccia grafici di funzioni                        #
#                                                                       #
#--Daniele Zambelli----------------------------------------------2002---#

from pyplot import *

def demo():
  fun='sin(1/x)'
  p0=Plot(fun, 600, 250, 100, 100)
  p0.axes()
  p0.setwidth(2)
  p0.xy(fun)
  p0.mainloop()
  fun='sqrt((x**2-4)/(x**2-25))'
  p1=Plot(fun, 600, 200)
  p1.seto((p1.geto()[0],150))
  p1.axes(1)
  p1.setwidth(2)
  p1.xy(fun)
  p1.mainloop()
  p2=Plot('Spirali', 600, 600, 10, 10)
  p2.axes()
  p2.setwidth(2)
  p2.polar('2*th', 1440)
  p2.reset()
  p2.setwidth(2)
  p2.polar('1.1**th', 2520)
  p2.mainloop()
  p3=Plot('Coordinate polari', 200, 200, 10, 10)
  p3.seto((30, p3.geto()[1]))
  p3.axes()
  p3.setwidth(2)
  p3.polar('10*cos(th)+5')
  p3.mainloop()
  p4=Plot('file: cos.fun', 600, 600)
  p4.setwidth(2)
  p4.graphfile('cos.fun')
  p4.mainloop()
  p4=Plot('file: cos.fun', 600, 600)
  p4.axes()
  p4.setwidth(2)
  p4.xy('.3*x**2+3*x+4')
  p4.yx('.3*y**2+3*y+4')
  p4.mainloop()

demo()
